CSC 254/454 Assignment 1

Write two programs computing the sum of the elements of an integer or floating-point array.  One uses loops and the other uses recursion (no data overwrite).   Use a small array to test the correctness of both programs; they should produce the same result.  Use a large array of at least 1000,000 elements and observe whether there is any behavior difference between these two programs.  You can use C, C++, or any other language of your choice.  You can also write them as two parts in the same program.  If so, write the recursion version in the second part.

Write a brief report in no more than two pages.  It should have two sections.  The first describes the experiment performed and the result observed.  Based on the observation, the second section discusses what you see are the basic problems in language design  and what is the role of language implementation.   I do not want you to explain why the two sum programs behave differently.  You will understand the underlying cause later in this class.  For this assignment, I want you to think about and articulate the basic issues in language design.

Send an electronic copy of your report to cs254@cs.rochester.edu.  Please format your report in plain text, postscript, or pdf.   Do not submit your programs.

The report is due midnight (11:59pm) next Monday, September 11.  Submissions received after that time will not be accepted.